{extend name="ashippingguide/Public/base" /}
{block name="container"}
<div class="page-heade">
    <h2 class="title_color text-center">导购转正提醒管理</h2>
</div>
<form action="" class="form-inline" id="form1" method="post">
    <table class="table table-bordered">
        <tr>
            <td>
                <button class="btn btn-primary addAprolvalWarn">新增</button>
            </td>
        </tr>
        <tr>
            <td><label for="name">姓名：</label><input type="text" class="form-control inputremindPeple" id="name"
                                                    name="name" value="<?php if(isset($name)) echo $name; ?>">
                <button class="btn btn-info" type="submit">查询</button>
                <span class="lr_5"></span>
                <button class="btn btn-info emtyif" id="reset" type="submit">清空查询条件</button>
            </td>
        </tr>
    </table>
</form>
<table class="table table-striped table-bordered table-hover bud_hei text-center aprovalSystemTable"
       style="width: 100%;">
    <tr class="info">
        <th class="text-center">No.</th>
        <th class="text-center">被提醒员工</th>
        <th class="text-center">提醒方式</th>
        <th class="text-center">操作</th>
    </tr>
    {volist name="data" id="list"}
    <tr>
        <td class="text-center">{$i}</td>
        <td class="text-center">{$list.name}</td>
        <td class="text-center">{$list.type}</td>
        <td class="text-center"><a href="javascript:;" class="delthis" onclick="del({$list.id})">删除</a></td>
    </tr>
    {/volist}
</table>
<script>
    $(document).ready(function () {
        $('#reset').on('click', function () {
            $("#form1 input").each(function () {
                $(this).val('');
            });
            $("#form1 select").each(function () {
                $(this).val('');
            });
            $('#form1').submit();
            return false
        })//Reminding
        $(".addAprolvalWarn").click(function () {
            layer.open({
                type: 2,
                title: '&nbsp;',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['800px', '400px'],
                content: '{:url("ashippingguide/addremindingp")}'
            })
            return false
        });
        // $(".xiugai").click(function () {
        //     var link = $(this).attr('href')
        //     layer.open({
        //         type: 2,
        //         title: '&nbsp;',
        //         shadeClose: true,
        //         shade: false,
        //         maxmin: true, //开启最大化最小化按钮
        //         area: ['800px', '500px'],
        //         content: link
        //     })
        //     return false
        // });
        // //删除

        // $('.shanchu').click(function () {
        //     var link = $(this).attr('href')
        //     swal({
        //         title: "您确定要删除这条信息吗",
        //         text: "删除后将无法恢复，请谨慎操作！",
        //         type: "warning",
        //         showCancelButton: true,
        //         confirmButtonColor: "#DD6B55",
        //         confirmButtonText: "删除",
        //         closeOnConfirm: false
        //     }, function (isConfirm) {
        //         if(isConfirm){
        //             $.ajax({
        //                 'type':'post',
        //                 'url':link,
        //                 'dataType':'json',
        //                 'success':function (data) {
        //                     if(data.success){
        //                         location.reload()
        //                     }else
        //                         swal(data.msg, "", "error");
        //                 }
        //             })
        //         }
        //
        //     });
        //     return false
        // });
    })
    function del(id){
        swal({
            title: "您确定要删除这条信息吗",
            text: "删除后将无法恢复，请谨慎操作！",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            closeOnConfirm: false
        }, function (isConfirm) {
            if(isConfirm){
                $.get("{:url('ashippingguide/delreminding')}",{id:id},function (e) {
                    if(e.success){
                        location.reload();
                    }else{
                        swal("网络错误！请重试", "", "error");
                    }
                },'json');
            }

        });
    }
</script>

{/block}
